<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>新闻类别添加</title>
	<head>
		<link rel="icon" href="${pageContext.request.contextPath}/favicon.ico"  type="image/x-icon"/>
		<link href="${pageContext.request.contextPath}/style/news.css" rel="stylesheet">
		<link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.css" rel="stylesheet">
		<link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
		<script src="${pageContext.request.contextPath}/bootstrap/js/jQuery.js"></script>
		<script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.js"></script>
	</head>
	<script type="text/javascript">
		function checkForm(){
			var newsTypeName=document.getElementById("newsTypeName").value;
			if(newsTypeName==null||newsTypeName==""){
				document.getElementById("error").innerHTML="新闻类别名称不能为空！";
				return false;
			}
			return true;
		}
	</script>
</head>
<body>
<div class="data_list backMain">
	<div class="dataHeader navi">
		当前位置：&nbsp;&nbsp;
		主页&nbsp;&nbsp;&gt;&nbsp;&nbsp;
		新闻类别管理&nbsp;&nbsp;&gt;&nbsp;&nbsp;
		新闻类别添加&nbsp;&nbsp;
	</div>
	<div class="data_content">
		<form action="${pageContext.request.contextPath}/type" method="post" onsubmit="return checkForm()">
			<input type="hidden" name="method" value="save">
			<table cellpadding="5">
				<tr>
					<td>
						<label>新闻类别名称：</label>
					</td>
					<td>
						<input type="text" id="typeName" name="typeName" value="${type.typeName}"/>
					</td>
				</tr>
				<tr>
					<td>
						<input type="hidden" id="id" name="id" value="${type.id}"/>
					</td>
					<td>
						<input type="submit" class="btn btn-primary" value="保存"/>&nbsp;&nbsp;
						<input type="button" class="btn btn-primary" value="返回" onclick="javascript:history.back()"/>&nbsp;&nbsp;<font id="error" color="red">${error }</font>
					</td>
				</tr>
				
			</table>
		</form>
	</div>
</div>
</body>
</html>